home *** CD-ROM | disk | FTP | other *** search
/ New Masters of Flash / New Masters of Flash.iso / pc / MOVIES / 05.dir / 00210_Text_text11.txt < prev    next >
Text File  |  2000-10-01  |  2KB  |  29 lines

  1. Frame 2: 
  2. (label Vertex Coordinates)
  3. Setting the Initial Point Coordinates
  4.  
  5. The script in frame 2 is responsible for setting the initial starting coordinates for the individual vertices.
  6.  
  7. 3D objects are made up of vertices that are basically reference points in 3D space. In a 3D environment, vertices have a Z co-ordinate as well as X and Y. The figure shows the vertex co-ordinates for a two-dimensional square of 100 units high and wide, with its center point at co-ordinate 0,0. Its co-ordinates consists of:
  8.  
  9. Point 1:  x=-50, y=-50
  10. Point 2:  x=50, y=-50
  11. Point 3:  x=-50, y=50
  12. Point 4:  x=50, y=50
  13.  
  14. To extrude this square into a cube, each vertex would also need a Z co-ordinate.So, the co-ordinates for a cube with the dimensions of a 100 units high, wide and deep with its centerpoint at co-ordinate at 0,0,0 will look like this:
  15.  
  16. Point 1: x=-50, y=-50, z=-50
  17. Point 2: x=50, y=-50, z=-50
  18. Point 3: x=-50, y=50, z=-50
  19. Point 4: x=50, y=50, z=-50
  20. Point 5: x=-50, y=-50, z=50
  21. Point 6: x=50, y=-50, z=50
  22. Point 7: x=-50, y=50, z=50
  23. Point 8: x=50, y=50, z=50
  24. For our purpose, these co-ordinates can be stored by using an array of variables (Variables: "x", "y" and "z") that would later be used to do the 3D calculation.You can do this manually by setting the value for variables "x", "y" and "z" individually.
  25.  
  26. Alternatively, you can write a looping script to do this. In this specific example, when the movie begins, I wanted all the points to line up in a line along the X-axis to spell out the name W-I-R-E-F-R-A-M-E. I wanted the first point (W) to be set at coordinate  ΓÇö80,0,0 (XYZ) and the last one at coordinate 80,0,0.
  27. I did this simply by running the following script, which uses ΓÇö80 as a starting point and increments the next pointΓÇÖs X-coordinate by 20, until point 9 is set at 80, while the Y and Z coordinates are set to 0.
  28. You can use script to create other geometric forms. For instance, for a spiral that twists around the X-axis, you can use the Sine and Cosine values that were set on the first frame.
  29.